﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BanGiaoSanPhamDeTai.ascx.cs" Inherits="QuanLyDeTaiKHCN.UserControls.Others.BanGiaoSanPhamDeTai" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="udt1" runat="server">
    <ContentTemplate>
        <div class="control-group info row-fluid" >
        <asp:Panel ID="pndanhsachdetaiduan" runat="server">
            <fieldset style="padding-bottom:5px;">
                <input type="hidden" runat="server" id="inputID" />
                <legend>Thông tin đề tài sau nghiệm thu</legend>
                <label class="control-label" style="width: 200px; padding-right: 10px;">Ngày bàn giao sản phẩm</label>
                <div class="controls">
                    <asp:TextBox ID="txtNgayBanGiaoSanPham" placeholder="Ngày/tháng/năm" runat="server" CssClass="span2" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/CSS/images/lich.gif" AlternateText="Click để hiển thị ngày tháng năm" />
                    <ajaxToolkit:CalendarExtender ID="calendarButtonExtender2" runat="server" TargetControlID="txtNgayBanGiaoSanPham" PopupButtonID="Image1" Format="dd/MM/yyyy" />
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" MaskType="Date" runat="server" Mask="99/99/9999" TargetControlID="txtNgayBanGiaoSanPham"></ajaxToolkit:MaskedEditExtender>
                    <asp:RequiredFieldValidator runat="server" ID="yc1" Text="Nhập ngày giao" Display="Dynamic" ForeColor="Red" ControlToValidate="txtNgayBanGiaoSanPham" ValidationGroup="kiemtra"></asp:RequiredFieldValidator>
                    <span style="color:#3A87BE;">&nbsp;&nbsp;Ngày đăng ký nhận kết quả&nbsp;&nbsp;</span>
                    <asp:TextBox ID="txtNgayDangKyNhanKetQua" placeholder="Ngày/tháng/năm" runat="server" CssClass="span2" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:ImageButton runat="Server" ID="ImageButton1" ImageUrl="~/CSS/images/lich.gif" AlternateText="Click để hiển thị ngày tháng năm" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtNgayDangKyNhanKetQua" PopupButtonID="ImageButton1" Format="dd/MM/yyyy" />
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" MaskType="Date" runat="server" Mask="99/99/9999" TargetControlID="txtNgayDangKyNhanKetQua"></ajaxToolkit:MaskedEditExtender>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="width: 200px; padding-right: 10px;">Đơn vị nhận sản phẩm</label>
                <div class="controls">
                    <asp:TextBox ID="txtDonViNhanBanGiao" runat="server" CssClass="span5" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" Text="Nhập tên đơn vị nhận" Display="Dynamic" ForeColor="Red" ControlToValidate="txtDonViNhanBanGiao" ValidationGroup="kiemtra"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="width: 200px; padding-right: 10px;">Đại diện đơn vị nhận</label>
                <div class="controls">
                    <asp:TextBox ID="txtDaiDienDonVi" runat="server" CssClass="span5" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" Text="Nhập đại diện đơn vị nhận" Display="Dynamic" ForeColor="Red" ControlToValidate="txtDaiDienDonVi" ValidationGroup="kiemtra"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="width:200px;padding-right:10px;"></label>
                <div class="controls">
                    <asp:LinkButton ID="btnsave" class="btn btn-primary" OnClick="btnsave_Click" ValidationGroup="kiemtra" runat="server"><i class=" icon-save"></i>&nbsp;&nbsp;Lưu</asp:LinkButton>
                    <asp:LinkButton ID="btnAdd" class="btn btn-primary" OnClick="btnAdd_Click" runat="server"><i class=" icon-plus"></i>&nbsp;&nbsp;Thêm đơn vị nhận</asp:LinkButton>
                    <asp:Label ID="lblstatus" runat="server" ForeColor="Red"></asp:Label>
                </div>
            </fieldset>
            <div style="height:15px;"></div>
            <fieldset style="padding:5px;">
                <legend>Danh sách đơn vị nhận bàn giao</legend>
                <asp:GridView ID="griddsdonvinhanbangiao" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" ForeColor="#333333" OnRowDeleting="griddsdonvinhanbangiao_RowDeleting" OnRowEditing="griddsdonvinhanbangiao_RowEditing">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="Tên đơn vị nhận">
                                <ItemTemplate>
                                    <asp:Label ID="lblID" runat="server" Visible="false" Text='<%#Eval("ID") %>'></asp:Label>
                                    <asp:Label ID="lblTenDonVi" runat="server" Text='<%#Eval("TenDonViNhan") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="ItemGridCell" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Đại diện đơn vị">
                                <ItemTemplate>
                                    <asp:Label ID="lblDaiDienDonVi" runat="server" Text='<%#Eval("DaiDienDonVi") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="ItemGridCell" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày nhận">
                                <ItemTemplate>
                                    <asp:Label ID="lblNgayDangKyNhanKetQua" runat="server" Text='<%#Eval("NgayDangKyKetQuan") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="ItemGridCell" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày đăng ký nhận kết quả">
                                <ItemTemplate>
                                    <asp:Label ID="lblNgayNhan" runat="server" Text='<%#Eval("NgayNhan") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle CssClass="ItemGridCell" />
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="true" HeaderText="Xóa">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="<i class='icon-remove red'></i> Xóa"></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="true" HeaderText="Chọn">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Edit" Text="<i class='icon-edit'></i> Chọn"></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
            </fieldset>
            <div style="height:15px;"></div>
            <fieldset style="padding-bottom:5px;">
                <legend>Các file hồ sơ liên quan</legend>
                <label class="control-label" style="width: 250px; padding-right: 10px;">Chọn file</label>
                <div class="controls">
                    <asp:FileUpload ID="filebienban" runat="server" />
                </div>
                <div style="height: 5px;"></div>
                <label class="control-label" style="width: 250px; padding-right: 10px;">Trích yếu</label>
                <div class="controls">
                    <asp:TextBox ID="txtghichufilethuyetminh" runat="server" TextMode="MultiLine" Height="50" CssClass="span6" onblur="KiemTraInjection(this);"></asp:TextBox>
                </div>
                <div style="height: 5px; clear: both"></div>
                <label class="control-label" style="width: 250px; padding-right: 10px;">Ngày nhận</label>
                <div class="controls">
                    <asp:TextBox ID="txtNgayNhan" placeholder="Ngày/tháng/năm" runat="server" CssClass="span2" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:ImageButton runat="Server" ID="ImageButton3" ImageUrl="~/CSS/images/lich.gif" AlternateText="Click để hiển thị ngày tháng năm" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtNgayNhan" PopupButtonID="ImageButton3" Format="dd/MM/yyyy" />
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender4" MaskType="Date" runat="server" Mask="99/99/9999" TargetControlID="txtNgayNhan"></ajaxToolkit:MaskedEditExtender>
                    <asp:RequiredFieldValidator runat="server" ValidationGroup="kiemtra1" ID="RequiredFieldValidator7" ControlToValidate="txtNgayNhan" Text="Nhập ngày nhận" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
                </div>
                <div style="height: 5px;"></div>
                <label class="control-label" style="width: 250px; padding-right: 10px;"></label>
                <div class="controls">
                    <asp:LinkButton ID="LinkAddFile" class="btn btn-primary" runat="server" OnClick="LinkAddFile_Click"><i class="icon-file-alt"></i>&nbsp;&nbsp;Thêm</asp:LinkButton>
                    <asp:Label ID="lblmessage" runat="server" ForeColor="Red"></asp:Label>
                </div>
                <div style="height: 5px;"></div>
                <div style="height: 5px; clear: both;"></div>
                <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" ForeColor="#333333" OnRowDeleting="grid_RowDeleting">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:TemplateField HeaderText="Trích yếu">
                            <ItemTemplate>
                                <%#Eval("TrichYeu") %>
                                <asp:Label ID="lblFileName" runat="server" Visible="false" Text='<%#Eval("FileThuyetMinh") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Ngày">
                            <ItemTemplate>
                                <%#Eval("NgayLuu") %>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="true" HeaderText="Xóa">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="<i class='icon-remove red'></i> Xóa"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="true" HeaderText="Xem">
                            <ItemTemplate>
                                <%--<a href='<%="./?mod="+_se.Encrypt("Xem_online_hoso","gold",128)+"&id="+Request.QueryString["id"]%>&linkonline=<%#Eval("Fileonline")%>' title="Chọn để xem nội dung"><i class='icon-folder-open-alt'></i>&nbsp;Xem</a>--%>
                                <a href='<%#QuanLyDeTaiKHCN.Obj_class.PageURL.local+"filehoso/"+Eval("FileThuyetMinh")%>'title="Chọn để xem nội dung"><i class='icon-folder-open-alt'></i>&nbsp;Xem</a>
                            </ItemTemplate>
                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>

            </fieldset>
        </asp:Panel>
            <div style="text-align:center;">
                <asp:Label ID="lblThongBao" runat="server" ForeColor="Red"></asp:Label>
            </div>
       </div>
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="LinkAddFile" />
    </Triggers>
</asp:UpdatePanel>